# Maintainer: Przemyslaw Pawelczyk <przemoc@zoho.com>
pkgname=rhash
pkgver=1.4.3
pkgrel=0
pkgdesc="Utility for calculation and verification of hash sums and magnet links"
url="http://rhash.anz.ru"
arch="all"
license="0BSD"
makedepends="openssl1.1-compat-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs"
source="https://downloads.sourceforge.net/rhash/rhash-$pkgver-src.tar.gz"
builddir="$srcdir/RHash-$pkgver"

build() {
	# --build and --host are not recognized
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--enable-openssl \
		--disable-openssl-runtime
	make
}

check() {
	make -C "$builddir" test-shared
}

package() {
	make -j1 DESTDIR="$pkgdir" install
	make DESTDIR="$pkgdir" \
		install-lib-headers install-lib-shared install-lib-so-link
}

sha512sums="
d87ffcde28d8f25cf775c279fed457e52d24523ed9b695629dae694b3c22372247d18f6032f8ce13a0b70fa2953be408982e46659daaa7c4ab227ae89eaed9c7  rhash-1.4.3-src.tar.gz
"
